|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectfurny.util.IOUtils
public final class IOUtils
Utility class for handling object<->byte[] conversion.
| Field Summary | |
|---|---|
private static java.util.logging.Logger |
LOGGER
|
| Constructor Summary | |
|---|---|
private |
IOUtils()
Instantiation is not allowed. |
| Method Summary | |
|---|---|
static java.awt.image.BufferedImage |
createImage(byte[] bytes)
Converts a byte array of image data to an image. |
static com.jme3.scene.Node |
createNode(byte[] bytes)
Converts a byte array to a JME node. |
static byte[] |
getBytes(java.io.File f)
Reads a file into a byte array. |
static byte[] |
getBytes(java.awt.Image image)
Converts an Image to a byte array. |
static byte[] |
getBytes(com.jme3.scene.Node node)
Converts a JME node to a byte array. |
private static java.util.List<com.jme3.material.Material> |
getMaterials(java.util.List<com.jme3.material.Material> list,
com.jme3.scene.Spatial node)
Gets recursively all materials from a spatial. |
static java.util.List<com.jme3.material.Material> |
getMaterials(com.jme3.scene.Node node)
Gets all materials from a node. |
static java.util.Map<com.jme3.texture.Texture,TextureData> |
getTextureData(com.jme3.material.Material mat)
Get a map of textures and texture data from a material. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final java.util.logging.Logger LOGGER
| Constructor Detail |
|---|
private IOUtils()
| Method Detail |
|---|
public static byte[] getBytes(java.awt.Image image)
throws java.io.IOException
Image to a byte array. The data will be in PNG format.
image - Image to convert.
java.io.IOException - if writing the PNG data fails.
public static java.awt.image.BufferedImage createImage(byte[] bytes)
throws java.io.IOException
bytes - The byte array, e.g. in JPG or PNG format.
java.io.IOException - if reading the image data fails.
public static byte[] getBytes(com.jme3.scene.Node node)
throws java.io.IOException
node - The node to convert.
java.io.IOException - if writing the byte array fails.
public static java.util.Map<com.jme3.texture.Texture,TextureData> getTextureData(com.jme3.material.Material mat)
throws java.io.IOException
mat - The material.
java.io.IOException - if writing the byte array fails.
public static byte[] getBytes(java.io.File f)
throws java.io.IOException
f - The file to read.
java.io.IOException - if reading the file fails.public static java.util.List<com.jme3.material.Material> getMaterials(com.jme3.scene.Node node)
node - The node to get materials from.
private static java.util.List<com.jme3.material.Material> getMaterials(java.util.List<com.jme3.material.Material> list,
com.jme3.scene.Spatial node)
list - Target list for the materials.node - The spatial (e.g. node).
public static com.jme3.scene.Node createNode(byte[] bytes)
throws java.io.IOException
bytes - The data of the node.
java.io.IOException - if reading the byte array fails or the data is no node data.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||